<form th:action="@{/admin/m/base/template/createFile.gsp}" id="addForm" role="form" class="form-horizontal" action="#" method="post">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">修改模板</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<input type="hidden" name="filePath" th:value="${result.filePath}" />
				<div class="form-group">
					<label class="col-md-3 control-label">模板名称：</label>
					<div class="col-md-7">
						<input name="fileName" readonly="readonly" th:value="${result.fileName}" placeholder="请输入模板名称" type="text" class="form-control" />
					</div>
				</div>
				<textarea name="content" id="codeMirror" th:text="${result.content}" style="width: 0px; height: 0px; position: absolute; border: none;"></textarea>
			</div>
		</div>

	</div>
	<div class="modal-footer">
		<button class="btn btn-primary" type="submit">
			<strong>提 交</strong>
		</button>
		<button type="button" class="btn btn-default" data-dismiss="modal">
			<strong>关 闭</strong>
		</button>
	</div>
</form>
<script th:inline="javascript">
    /*<![CDATA[*/
    //加载完成后执行
    var editor_two = CodeMirror.fromTextArea(document.getElementById("codeMirror"), {
        lineNumbers : true,
        matchBrackets : true
    });
    $("#templateWin").on("shown.bs.modal", function() {
        editor_two.refresh();
    });

    $(function() {
        var rules = {
            fileName : {
                required : true,
                maxlength : 20
            },
            content : {
                required : true
            }
        }
        var messages = {

        }
        fileListTable.add('templateWin', 'addForm', rules, messages);
    });
    /*]]>*/
</script>